package com.example.damaimaven.mapper;

import com.example.damaimaven.entity.Cart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zzh
 * @since 2024-07-09
 */
public interface CartMapper extends BaseMapper<Cart> {


    @Select("select a.*," +
            "pname `product.pname`," +
            "shop_price `product.shopPrice`," +
            "image `product.image`" +
            " from cart a join product b on a.pid=b.pid" +
            " where uid=#{uid}")
    List<Cart> selectMyCart(int uid);

}
